#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<cstdio>
using namespace std;
int n;
long long arr[300005];
int compare(const void* p1, const void* p2)
{
    if (*((long long*)p1) > *((long long*)p2))return 1;
    else return -1;
}
long long sum = 0;
int main() {
    cin >> n;
    for (int i = 0; i < n * 3; i++) {
        scanf("%lld", &arr[i]);
    }
    qsort(arr, 3 * n, sizeof(arr[0]), compare);
    for (int i = 0; i < n; i++) {
        sum += arr[3 * n - 2 - i * 2];
    }
    cout << sum << endl;
    return 0;
}